worldinconflictfandomcom-20200213-history
Map and Mod Wiki/Nodes
Nodes Introduction A node in the showbox is pretty much a small object with a mesh, that you’ve created in your 3d application. It can be attached to your main object. Usually nodes are smaller props that can be used as decals or details on your bigger objects. Examples of a couple of nodes are: * Billboards and other types of props that can be attached on other objects. * Slots – control where the infantry will stand once they garrison a building. * Hurt-nodes (WreckFx) which can be used to show that houses, vehicles etc have taken damage and is about to be destroyed. * Wires – position out where the wires can be attached. What’s really good about nodes is that you can have a library of finished nodes, for example billboards and signs, that you can attach to different types of objects. You can also randomize textures on the nodes so that two houses with the same nodes can look different, which is a pretty neat feature. To randomize the texture, you have to name your texture right and it’ll do it automatically. For example, if your texture is called “house.dds” and you make a texture version. You should call them “house_rand1of2.dds” and “house_rand2of2.dds”. If you have more than two variants, you just change the “of2” to the amount of textures you have. Under the different tabs you’ll find different things. In WreckFX you’ll find the WreckFX. Under wires, you’ll find where you add wires. Under positions you’ll find all the props and signs. The slot tab is for slots. Image:Nodeeditor.jpg How to use nodes Once you click on the Nodes button in the showbox, there will be a popup window that looks like the image to the right. When you have selected a node from one of the libraries, you can spawn them by holding Shift and left-clicking where you want to place your node. The node will snap to the geometry (or grid) at your mouse-cursor. The node you just placed has got a Yellow marker, this means it’s selected. By selecting another node in the library you will replace the node you have in your selection. Image:Wrecks.jpg When you first spawn a node it won’t be visible with these settings because they are WreckFx. WreckFx are more or less indicators that the object you attach them to is being damaged and is only activated after your object has received a certain amount of damage. See image When you first spawn a node, it will spawn in the STND state, (which is the state where the object has 100% health) and therefore won’t be visible. (Note that this only goes for Wreck nodes) In order to change that, you have to change the main window states to hurt1 or hurt2. HUR1 is the state the object will enter once it has been damaged a little. HUR2 is when it’s been damaged a lot. In HUR3 these nodes are created to blow up or just disappear. This is because when the object enters the HUR3 state, it will be destroyed and you don’t want things hanging in the air after the buildings have been destroyed. If you want to select a new node or select multiple nodes, hold down the Ctrl key and left click on them. Tips: Wrecknodes and slots are placed the same way How to make a new node in Modo When you make a new node you should make it facing towards –Z (In modo, it’d be +Z in lightwave) because then it’ll be correctly rotated when you spawn it in the showbox. Remember that if you are going to do a node with more than one surface, you’ll need to split your mesh into different layers since you can only have one surface per layer.If you want to create a WreckFx, you can make a layout like this: Hurt1: the layer for the first hurtstate of what will be visible in the hurt1 state Hurt2: the second and final hurtstate. Inside: if the node is a hole in a building for example, you will need to put the inside in this separate layer. Void: you will only need this layer if you have an “inside” layer. This way, you can simply activate and deactivate the different layers depending on what state you want to show. Also, hurt2, inside and void will be visible in the same state, but since they have different surfaces they will need different layers. Tips: you can’t use two diffuse textures in one layer, so if you want to optimize and reduce draw calls. Try to only use max one texture per state. Setting up the Scene in Lightwave If you want your node to spawn particles, smoke, rubble or whatever, it might be wise to add a null so you can control where you want the particles to emit from. So when you have saved it as an LWS in lightwave layout. You may open the file in the showbox. With default settings, you load your LWO file into lightwave with the + key on the numpad. If you want to make a new slot node, you will need to make two lws scenes, one where the window opens and one where it closes again. Node LOD's Bigger props like banners, billboards etc. should be lodded like any other prop. The nodes that uses void polygons (Polygons using the Void vertex Shader, ill get into it later) only have a lod2 which contains pretty much only one polygon. The easiest way to lod is to copy the void polygon and paste it into the first layer. And save it with the same name as the original file, only adding “_lod2”. Don’t forget to change the texture/material to what was used in the first layer before or it might flip out. Wreck FX When you make a WreckFx, you want it to give the player an indication of how damaged the object you placed it on really is. So when it’s not damaged, it won’t be active. When it’s a little damaged, it will show something small like burn marks or bullet holes. When it’s been damaged a lot, you see holes in the walls for example. Load your lws normally into a STND state. Then use theAdd Complete State button in order to create more states. So when you click it, add the same Lws that you just opened only select “(hurt a little)”. Repeat this and add the “(somewhat hurt)” and “(hurt a lot)” state. When you have these states, the game will automatically switch between them depending on how much health the parent object has. Image:Hieracy.jpg If you check your hierarchy it should look like the hierarchy in the image, right click somewhere in the white hierarchy area and select Full. Now you can unfold the layers in your hierarchy and allows you to see all the states of that layer. Select STND state and there will be some settings to configure in the lower part of the screen. Check the image below. Image:Animation.jpg Your layer shouldn’t be active in STND because you don’t want anything to show when the object is at 100% health right? Tips: If you have problems with an animated node, set the start interpolation time on 0 and click on apply to all. I do this because if you got some animation, you generally don’t want an interpolation between the states. Especially if you don’t have anything to interpolate between, then it can flip out if you’re unlucky. So if you got problems with snapping geometry, try it! Note that this doesn’t only go for nodes, but for all static objects that are animated, like houses etc. Now you know where the settings are for the states so now you have to go through all the states in your scene and make them active or inactive. Hurt1 layer should obviously be visible in HUR1. The layer containing the inside, the void polygon and the rest if you have anything should only be visible in HUR2. Nothing should be visible in HUR3, except the particle emitter if you have one because you don’t want anything hanging in the air. It’s always cool to add a smaller explosion in HUR3. It can also help if you feel that your node is “popping” when it enters HUR3. Try switching between the states F1, F2, F3 and F4 to see if it works. The void polygon will look a bit funky when you build the node. To see if it really works you have to add it as a node on another object. MRB export, script it and you’ll see it in the node-library, ready to be tested! Setting up for SlotNodes (Slots) You load the scene containing either the open- or close-animation. When you get the popup to select state you should use the close slot or Open slot state. Now click Add Complete State, select the other lws file and load it with the other state (close or open). To see if you’ve done it right this far, try switching state with F1 and F2 and see if the window opens and closes. If it does, you’re pretty much done. All that remains is to select surfaces, make sure it has lods. Slots shouldn’t have any physics and rarely have any shadow files. When you then add slots to your house, don’t forget to add a door to indicate where the infantry is going to enter the building. You don’t need to make a slot for the nodes, if you want your infantry to stand on the roof for example. You can add a simple slot, you find it in the Slots submenu. When adding doors, make sure they are placed outside the AI path box, otherwice you will get errors. Slots are added to the MRB like any other node. To move slots and doors around, the easiest way is to select the slot in the "game node list", and then move it around for a rough placement with the mouse. After that finetune it with the arrow keys, (ctrl + arrowkeys will make it move in bigger steps.) Image:Slotsanddoors.jpg Note: When adding slots, add it all the places you want the units to be able to stand. When ingame, the units will move around on the diffrent slots in order to get the best shot at the enemy. Fake depth using the Void Shader When you create a node that you want to have depth, lets say you want to blow a hole in your house so you can see some interior. Or if you make a slot node that opens a window, you will probably want to make a small room behind the window. You do this by giving your Void Polygon the standard diffuse surface. Then go to the mesh tab and select Void_Shader under the Vertex shader option. This means that what is behind the void polygon will be rendered before everything else. Image:Voidpolyinmodo.jpg Note: that the normals of the void is pointing out towards –Z (in modo) and the normals of the inside are flipped and also points towards –Z. Image:Topview.jpg Above: The order of the polygons in modo from top view. Image:Shownvoid.jpg Example of how the wrecknode could look Shadows for Nodes Remember you don’t have to make shadows for decals or insides. Shadows for bigger props are exactly the same as for a normal props. Wires You add wires the same way you do with slots, only this cost nothing for the performance of the game so you can add a lot of them. I usually put around four in each corner of the house or where it fits best. There are two types, internal and external wires. The name speaks pretty much for itself, internal wires are connected within the same house and external wires are connected on the outside. You don’t connect wires in the showbox, it’s done in the map editor. What you do in the showbox is only adding a location where you can attach wires in the level editor later on. Scripting Nodes Take a look at Category:Juicemaker. Category:Map and Mod Wiki/Showbox